Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve activeTab URL modifications #2503

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

rwd
Copy link
Contributor

@rwd rwd commented Dec 5, 2024

Issues this addresses

  1. when opening an item page with any sidebar content, #links is always added to the url if there is a IIIF manifest but no annotations or anno search, but this is undesirable if the sidebar is not open
  2. back/forward browser navigation goes between tabs on item page before going back to e.g. search results

Changes

activeTab composable:

  • don't watch activeTabIndex by default, but return a function to start watching on-demand, plus one to stop watching
  • switch to using router replace so that browser back/forward navigation doesn't loop through the tabs

ItemMediaSidebar:

  • add a show prop to control visibility
  • only watch activeTabIndex changes when component is shown (according to that prop)
    • preventing immediate triggering of it on initialisation always selecting the first tab's index & hash

ItemMediaPresentation:

  • pass show prop to ItemMediaSidebar based on value of showSidebar

Copy link

github-actions bot commented Dec 5, 2024

Preview deployment: https://pr-2503.portal-js.dev.eanadev.org/

@lbiedinger lbiedinger merged commit eff143f into master Dec 9, 2024
17 of 18 checks passed
@lbiedinger lbiedinger deleted the refactor/improve-activeTab-url-modding branch December 9, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants